home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / PInterfaces / Devices.p < prev    next >
Text File  |  1996-05-01  |  26KB  |  672 lines

  1. {
  2.      File:        Devices.p
  3.  
  4.      Contains:    Device Manager Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5 and 8
  7.                  Release:    Universal Interfaces 3.0d3 on Copland DR1
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT Devices;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __DEVICES__}
  28. {$SETC __DEVICES__ := 1}
  29.  
  30. {$I+}
  31. {$SETC DevicesIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __OSUTILS__}
  35. {$I OSUtils.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __FILES__}
  38. {$I Files.p}
  39. {$ENDC}
  40. {$IFC UNDEFINED __QUICKDRAW__}
  41. {$I Quickdraw.p}
  42. {$ENDC}
  43. {$IFC UNDEFINED __EVENTS__}
  44. {$I Events.p}
  45. {$ENDC}
  46. {$IFC FOR_SYSTEM7_ONLY }
  47. {$IFC UNDEFINED __DIALOGS__}
  48. {$I Dialogs.p}
  49. {$ENDC}
  50. {$ENDC}
  51. {$IFC UNDEFINED __KERNEL__}
  52. {$I Kernel.p}
  53. {$ENDC}
  54. {$IFC UNDEFINED __NAMEREGISTRY__}
  55. {$I NameRegistry.p}
  56. {$ENDC}
  57. {$IFC UNDEFINED __CODEFRAGMENTS__}
  58. {$I CodeFragments.p}
  59. {$ENDC}
  60. {$IFC UNDEFINED __DRIVERFAMILYMATCHING__}
  61. {$I DriverFamilyMatching.p}
  62. {$ENDC}
  63. {$IFC UNDEFINED __IOITERATOR__}
  64. {$I IOIterator.p}
  65. {$ENDC}
  66.  
  67. {$PUSH}
  68. {$ALIGN MAC68K}
  69. {$LibExport+}
  70.  
  71. {  Values of the 'message' parameter to a Chooser device package  }
  72.  
  73. CONST
  74.     chooserInitMsg                = 11;                            {  the user selected this device package  }
  75.     newSelMsg                    = 12;                            {  the user made new device selections  }
  76.     fillListMsg                    = 13;                            {  fill the device list with choices  }
  77.     getSelMsg                    = 14;                            {  mark one or more choices as selected  }
  78.     selectMsg                    = 15;                            {  the user made a selection  }
  79.     deselectMsg                    = 16;                            {  the user canceled a selection  }
  80.     terminateMsg                = 17;                            {  allows device package to clean up  }
  81.     buttonMsg                    = 19;                            {  the user selected a button  }
  82.  
  83. {  Values of the 'caller' parameter to a Chooser device package  }
  84.     chooserID                    = 1;
  85.  
  86. {  Values of the 'message' parameter to a Control Panel 'cdev'  }
  87.     initDev                        = 0;                            { Time for cdev to initialize itself }
  88.     hitDev                        = 1;                            { Hit on one of my items }
  89.     closeDev                    = 2;                            { Close yourself }
  90.     nulDev                        = 3;                            { Null event }
  91.     updateDev                    = 4;                            { Update event }
  92.     activDev                    = 5;                            { Activate event }
  93.     deactivDev                    = 6;                            { Deactivate event }
  94.     keyEvtDev                    = 7;                            { Key down/auto key }
  95.     macDev                        = 8;                            { Decide whether or not to show up }
  96.     undoDev                        = 9;
  97.     cutDev                        = 10;
  98.     copyDev                        = 11;
  99.     pasteDev                    = 12;
  100.     clearDev                    = 13;
  101.     cursorDev                    = 14;
  102.  
  103. {  Special values a Control Panel 'cdev' can return  }
  104.     cdevGenErr                    = -1;                            { General error; gray cdev w/o alert }
  105.     cdevMemErr                    = 0;                            { Memory shortfall; alert user please }
  106.     cdevResErr                    = 1;                            { Couldn't get a needed resource; alert }
  107.     cdevUnset                    = 3;                            {  cdevValue is initialized to this }
  108.  
  109. {  Values of the 'message' parameter to a Monitor 'mntr'  }
  110.     initMsg                        = 1;                            { initialization }
  111.     okMsg                        = 2;                            { user clicked OK button }
  112.     cancelMsg                    = 3;                            { user clicked Cancel button }
  113.     hitMsg                        = 4;                            { user clicked control in Options dialog }
  114.     nulMsg                        = 5;                            { periodic event }
  115.     updateMsg                    = 6;                            { update event }
  116.     activateMsg                    = 7;                            { not used }
  117.     deactivateMsg                = 8;                            { not used }
  118.     keyEvtMsg                    = 9;                            { keyboard event }
  119.     superMsg                    = 10;                            { show superuser controls }
  120.     normalMsg                    = 11;                            { show only normal controls }
  121.     startupMsg                    = 12;                            { code has been loaded }
  122.  
  123. {  control codes for DeskAccessories  }
  124.     goodbye                        = -1;                            {  heap being reinitialized  }
  125.     killCode                    = 1;                            {  KillIO requested  }
  126.     accEvent                    = 64;                            {  handle an event  }
  127.     accRun                        = 65;                            {  time for periodic action  }
  128.     accCursor                    = 66;                            {  change cursor shape  }
  129.     accMenu                        = 67;                            {  handle menu item  }
  130.     accUndo                        = 68;                            {  handle undo command  }
  131.     accCut                        = 70;                            {  handle cut command  }
  132.     accCopy                        = 71;                            {  handle copy command  }
  133.     accPaste                    = 72;                            {  handle paste command  }
  134.     accClear                    = 73;                            {  handle clear command  }
  135.  
  136. {  Control/Status Call Codes  }
  137.     drvStsCode                    = 8;                            {  status call code for drive status  }
  138.     ejectCode                    = 7;                            {  control call eject code  }
  139.     tgBuffCode                    = 8;                            {  set tag buffer code  }
  140.  
  141. {  miscellaneous Device Manager constants  }
  142.     ioInProgress                = 1;                            {  predefined value of ioResult while I/O is pending  }
  143.     aRdCmd                        = 2;                            {  low byte of ioTrap for Read calls  }
  144.     aWrCmd                        = 3;                            {  low byte of ioTrap for Write calls  }
  145.     asyncTrpBit                    = 10;                            {  trap word modifier  }
  146.     noQueueBit                    = 9;                            {  trap word modifier  }
  147.  
  148. {  flags used in the driver header and device control entry  }
  149.     dReadEnable                    = 0;                            {  set if driver responds to read requests  }
  150.     dWritEnable                    = 1;                            {  set if driver responds to write requests  }
  151.     dCtlEnable                    = 2;                            {  set if driver responds to control requests  }
  152.     dStatEnable                    = 3;                            {  set if driver responds to status requests  }
  153.     dNeedGoodBye                = 4;                            {  set if driver needs time for performing periodic tasks  }
  154.     dNeedTime                    = 5;                            {  set if driver needs time for performing periodic tasks  }
  155.     dNeedLock                    = 6;                            {  set if driver must be locked in memory as soon as it is opened  }
  156.     dNeedLockMask                = $4000;                        {  set if driver must be locked in memory as soon as it is opened  }
  157.     dNeedTimeMask                = $2000;                        {  set if driver needs time for performing periodic tasks  }
  158.     dNeedGoodByeMask            = $1000;                        {  set if driver needs to be called before the application heap is initialized  }
  159.     dStatEnableMask                = $0800;                        {  set if driver responds to status requests  }
  160.     dCtlEnableMask                = $0400;                        {  set if driver responds to control requests  }
  161.     dWritEnableMask                = $0200;                        {  set if driver responds to write requests  }
  162.     dReadEnableMask                = $0100;                        {  set if driver responds to read requests  }
  163.  
  164. {  run-time flags used in the device control entry  }
  165.     dOpened                        = 5;                            {  driver is open  }
  166.     dRAMBased                    = 6;                            {  dCtlDriver is a handle (1) or pointer (0)  }
  167.     drvrActive                    = 7;                            {  driver is currently processing a request  }
  168.     drvrActiveMask                = $0080;                        {  driver is currently processing a request  }
  169.     dRAMBasedMask                = $0040;                        {  dCtlDriver is a handle (1) or pointer (0)  }
  170.     dOpenedMask                    = $0020;                        {  driver is open  }
  171.  
  172.  
  173. TYPE
  174.     DRVRHeaderPtr = ^DRVRHeader;
  175.     DRVRHeader = RECORD
  176.         drvrFlags:                INTEGER;
  177.         drvrDelay:                INTEGER;
  178.         drvrEMask:                INTEGER;
  179.         drvrMenu:                INTEGER;
  180.         drvrOpen:                INTEGER;
  181.         drvrPrime:                INTEGER;
  182.         drvrCtl:                INTEGER;
  183.         drvrStatus:                INTEGER;
  184.         drvrClose:                INTEGER;
  185.         drvrName:                SInt8;
  186.     END;
  187.  
  188.     DRVRHeaderHandle                    = ^DRVRHeaderPtr;
  189. {$IFC FOR_SYSTEM7_ONLY }
  190.     DCtlEntryPtr = ^DCtlEntry;
  191.     DCtlEntry = RECORD
  192.         dCtlDriver:                Ptr;
  193.         dCtlFlags:                INTEGER;
  194.         dCtlQHdr:                QHdr;
  195.         dCtlPosition:            LONGINT;
  196.         dCtlStorage:            Handle;
  197.         dCtlRefNum:                INTEGER;
  198.         dCtlCurTicks:            LONGINT;
  199.         dCtlWindow:                WindowPtr;
  200.         dCtlDelay:                INTEGER;
  201.         dCtlEMask:                INTEGER;
  202.         dCtlMenu:                INTEGER;
  203.     END;
  204.  
  205. {$ELSEC}
  206.     DCtlEntry = RECORD
  207.         dCtlDriver:                Ptr;
  208.         dCtlFlags:                INTEGER;
  209.         dCtlQHdr:                QHdr;
  210.         dCtlPosition:            LONGINT;
  211.         dCtlStorage:            Handle;
  212.         dCtlRefNum:                INTEGER;
  213.         dCtlCurTicks:            LONGINT;
  214.         dCtlWindow:                Ptr;
  215.         dCtlDelay:                INTEGER;
  216.         dCtlEMask:                INTEGER;
  217.         dCtlMenu:                INTEGER;
  218.     END;
  219.  
  220. {$ENDC}
  221.     DCtlPtr                                = ^DCtlEntry;
  222.     DCtlHandle                            = ^DCtlPtr;
  223. {$IFC FOR_SYSTEM7_ONLY }
  224.     AuxDCEPtr = ^AuxDCE;
  225.     AuxDCE = PACKED RECORD
  226.         dCtlDriver:                Ptr;
  227.         dCtlFlags:                INTEGER;
  228.         dCtlQHdr:                QHdr;
  229.         dCtlPosition:            LONGINT;
  230.         dCtlStorage:            Handle;
  231.         dCtlRefNum:                INTEGER;
  232.         dCtlCurTicks:            LONGINT;
  233.         dCtlWindow:                GrafPtr;
  234.         dCtlDelay:                INTEGER;
  235.         dCtlEMask:                INTEGER;
  236.         dCtlMenu:                INTEGER;
  237.         dCtlSlot:                SInt8;
  238.         dCtlSlotId:                SInt8;
  239.         dCtlDevBase:            LONGINT;
  240.         dCtlOwner:                Ptr;
  241.         dCtlExtDev:                SInt8;
  242.         fillByte:                SInt8;
  243.         dCtlNodeID:                UInt32;
  244.     END;
  245.  
  246.     AuxDCEHandle                        = ^AuxDCEPtr;
  247. {$ELSEC}
  248.     AuxDCEPtr = ^AuxDCE;
  249.     AuxDCE = PACKED RECORD
  250.         dCtlDriver:                Ptr;
  251.         dCtlFlags:                INTEGER;
  252.         dCtlQHdr:                QHdr;
  253.         dCtlPosition:            LONGINT;
  254.         dCtlStorage:            Handle;
  255.         dCtlRefNum:                INTEGER;
  256.         dCtlCurTicks:            LONGINT;
  257.         dCtlWindow:                Ptr;
  258.         dCtlDelay:                INTEGER;
  259.         dCtlEMask:                INTEGER;
  260.         dCtlMenu:                INTEGER;
  261.         dCtlSlot:                SInt8;
  262.         dCtlSlotId:                SInt8;
  263.         dCtlDevBase:            LONGINT;
  264.         dCtlOwner:                Ptr;
  265.         dCtlExtDev:                SInt8;
  266.         fillByte:                SInt8;
  267.         dCtlNodeID:                UInt32;
  268.     END;
  269.  
  270.     AuxDCEHandle                        = ^AuxDCEPtr;
  271. {$ENDC}
  272. {     The NDRV Driver IO Entry Point and Commands  }
  273.     UnitNumber                            = UInt16;
  274.     DriverOpenCount                        = UInt32;
  275.     DriverRefNum                        = SInt16;
  276.     DriverFlags                            = SInt16;
  277.     IOCommandCode                        = UInt32;
  278.  
  279. CONST
  280.     kOpenCommand                = 0;
  281.     kCloseCommand                = 1;
  282.     kReadCommand                = 2;
  283.     kWriteCommand                = 3;
  284.     kControlCommand                = 4;
  285.     kStatusCommand                = 5;
  286.     kKillIOCommand                = 6;
  287.     kInitializeCommand            = 7;                            {  init driver and device }
  288.     kFinalizeCommand            = 8;                            {  shutdown driver and device }
  289.     kReplaceCommand                = 9;                            {  replace an old driver }
  290.     kSupersededCommand            = 10;                            {  prepare to be replaced by a new driver }
  291.  
  292.  
  293. TYPE
  294.     IOCommandID = ^LONGINT;
  295.     IOCommandKind                        = UInt32;
  296.  
  297. CONST
  298.     kSynchronousIOCommandKind    = $00000001;
  299.     kAsynchronousIOCommandKind    = $00000002;
  300.     kImmediateIOCommandKind        = $00000004;
  301.  
  302.  
  303. TYPE
  304.     DriverInitInfoPtr = ^DriverInitInfo;
  305.     DriverInitInfo = RECORD
  306.         refNum:                    DriverRefNum;
  307.         deviceEntry:            RegEntryRef;
  308.     END;
  309.  
  310.     DriverReplaceInfo                    = DriverInitInfo;
  311.     DriverReplaceInfoPtr                 = ^DriverReplaceInfo;
  312.     DriverFinalInfoPtr = ^DriverFinalInfo;
  313.     DriverFinalInfo = RECORD
  314.         refNum:                    DriverRefNum;
  315.         deviceEntry:            RegEntryRef;
  316.     END;
  317.  
  318.     DriverSupersededInfo                = DriverFinalInfo;
  319.     DriverSupersededInfoPtr             = ^DriverSupersededInfo;
  320. {$IFC FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED }
  321. {  Contents are command specific }
  322.     IOCommandContentsPtr = ^IOCommandContents;
  323.     IOCommandContents = RECORD
  324.         CASE INTEGER OF
  325.         0: (
  326.             pb:                    ParmBlkPtr;
  327.             );
  328.         1: (
  329.             initialInfo:        DriverInitInfoPtr;
  330.             );
  331.         2: (
  332.             finalInfo:            DriverFinalInfoPtr;
  333.             );
  334.         3: (
  335.             replaceInfo:        DriverReplaceInfoPtr;
  336.             );
  337.         4: (
  338.             supersededInfo:        DriverSupersededInfoPtr;
  339.             );
  340.     END;
  341.  
  342. {$ELSEC}
  343.     ParamBlockRecPtr = ^ParamBlockRec;
  344.     ParamBlockRec = RECORD
  345.         qLink:                    QElemPtr;                                { queue link in header }
  346.         qType:                    INTEGER;                                { type byte for safety check }
  347.         ioTrap:                    INTEGER;                                { FS: the Trap }
  348.         ioCmdAddr:                Ptr;                                    { FS: address to dispatch to }
  349.         ioCompletion:            ProcPtr;                                { completion routine addr (0 for synch calls) }
  350.         ioResult:                OSErr;                                    { result code }
  351.         ioNamePtr:                StringPtr;                                { ptr to Vol:FileName string }
  352.         ioVRefNum:                INTEGER;                                { volume refnum (DrvNum for Eject and MountVol) }
  353.         CASE INTEGER OF
  354.         0: (
  355.             ioRefNum:            INTEGER;                                { refNum for I/O operation }
  356.             ioVersNum:            SInt8;                                    { version number }
  357.             ioPermssn:            SInt8;                                    { Open: permissions (byte) }
  358.             ioMisc:                Ptr;                                    { Rename: new name (GetEOF,SetEOF: logical end of file) (Open: optional ptr to buffer) (SetFileType: new type) }
  359.             ioBuffer:            Ptr;                                    { data buffer Ptr }
  360.             ioReqCount:            LONGINT;                                { requested byte count; also = ioNewDirID }
  361.             ioActCount:            LONGINT;                                { actual byte count completed }
  362.             ioPosMode:            INTEGER;                                { initial file positioning }
  363.             ioPosOffset:        LONGINT;                                { file position offset }
  364.            );
  365.         1: (
  366.             ioCRefNum:            INTEGER;                                { refNum for I/O operation }
  367.             csCode:                INTEGER;                                { word for control status code }
  368.             csParam:            ARRAY [0..10] OF INTEGER;                { operation-defined parameters }
  369.            );
  370.     END;
  371.  
  372.     ParmBlkPtr                            = ^ParamBlockRec;
  373.     IOCommandContents = RECORD
  374.         CASE INTEGER OF
  375.         0: (
  376.             pb:                    ParmBlkPtr;
  377.             );
  378.         1: (
  379.             initialInfo:        DriverInitInfoPtr;
  380.             );
  381.         2: (
  382.             finalInfo:            DriverFinalInfoPtr;
  383.             );
  384.         3: (
  385.             replaceInfo:        DriverReplaceInfoPtr;
  386.             );
  387.         4: (
  388.             supersededInfo:        DriverSupersededInfoPtr;
  389.             );
  390.     END;
  391.  
  392. {$ENDC}
  393.     DriverEntryPointPtr = ProcPtr;  { FUNCTION DriverEntryPointPtr(SpaceID: AddressSpaceID; CommandID: IOCommandID; Contents: IOCommandContents; Code: IOCommandCode; Kind: IOCommandKind): OSErr; C; }
  394.  
  395. {  Record to describe a file-based driver candidate  }
  396.     FileBasedDriverRecordPtr = ^FileBasedDriverRecord;
  397.     FileBasedDriverRecord = RECORD
  398.         theSpec:                FSSpec;                                    {  file specification }
  399.         theType:                DriverType;                                {  nameInfoStr + version number }
  400.         compatibleProp:            BOOLEAN;                                {  true if matched using a compatible name }
  401.         pad:                    PACKED ARRAY [0..2] OF UInt8;            {  alignment }
  402.     END;
  403.  
  404. {  Driver Loader API  }
  405. {$IFC FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED }
  406. FUNCTION HigherDriverVersion(VAR driverVersion1: NumVersion; VAR driverVersion2: NumVersion): SInt16; C;
  407. FUNCTION VerifyFragmentAsDriver(fragmentConnID: CFragConnectionID; VAR fragmentMain: DriverEntryPointPtr; VAR driverDesc: DriverDescriptionPtr): OSErr; C;
  408. FUNCTION GetDriverMemoryFragment(memAddr: Ptr; length: LONGINT; fragName: Str63; VAR fragmentConnID: CFragConnectionID; VAR fragmentMain: DriverEntryPointPtr; VAR driverDesc: DriverDescriptionPtr): OSErr; C;
  409. FUNCTION GetDriverDiskFragment(fragmentSpec: FSSpecPtr; VAR fragmentConnID: CFragConnectionID; VAR fragmentMain: DriverEntryPointPtr; VAR driverDesc: DriverDescriptionPtr): OSErr; C;
  410. {$IFC FOR_SYSTEM7_ONLY }
  411. FUNCTION InstallDriverFromFragment(fragmentConnID: CFragConnectionID; VAR device: RegEntryID; beginningUnit: UnitNumber; endingUnit: UnitNumber; VAR refNum: DriverRefNum): OSErr; C;
  412. FUNCTION InstallDriverFromFile(fragmentSpec: FSSpecPtr; VAR device: RegEntryID; beginningUnit: UnitNumber; endingUnit: UnitNumber; VAR refNum: DriverRefNum): OSErr; C;
  413. FUNCTION InstallDriverFromMemory(memory: Ptr; length: LONGINT; fragName: Str63; VAR device: RegEntryID; beginningUnit: UnitNumber; endingUnit: UnitNumber; VAR refNum: DriverRefNum): OSErr; C;
  414. FUNCTION InstallDriverFromDisk(theDriverName: Ptr; VAR theDevice: RegEntryID; theBeginningUnit: UnitNumber; theEndingUnit: UnitNumber; VAR theRefNum: DriverRefNum): OSErr; C;
  415. FUNCTION FindDriversForDevice(VAR device: RegEntryID; VAR fragmentSpec: FSSpec; VAR fileDriverDesc: DriverDescription; VAR memAddr: Ptr; VAR length: LONGINT; fragName: StringPtr; VAR memDriverDesc: DriverDescription): OSErr; C;
  416. FUNCTION FindDriverCandidates(VAR deviceID: RegEntryID; VAR propBasedDriver: Ptr; VAR propBasedDriverSize: RegPropertyValueSize; deviceName: StringPtr; VAR propBasedDriverType: DriverType; VAR gotPropBasedDriver: BOOLEAN; fileBasedDrivers: FileBasedDriverRecordPtr; VAR nFileBasedDrivers: ItemCount): OSErr; C;
  417. FUNCTION ScanDriverCandidates(VAR deviceID: RegEntryID; fileBasedDrivers: FileBasedDriverRecordPtr; nFileBasedDrivers: ItemCount; matchingDrivers: FileBasedDriverRecordPtr; VAR nMatchingDrivers: ItemCount): OSErr; C;
  418. FUNCTION GetDriverForDevice(VAR device: RegEntryID; VAR fragmentConnID: CFragConnectionID; VAR fragmentMain: DriverEntryPointPtr; VAR driverDesc: DriverDescriptionPtr): OSErr; C;
  419. FUNCTION InstallDriverForDevice(VAR device: RegEntryID; beginningUnit: UnitNumber; endingUnit: UnitNumber; VAR refNum: DriverRefNum): OSErr; C;
  420. FUNCTION GetDriverInformation(refNum: DriverRefNum; VAR unitNum: UnitNumber; VAR flags: DriverFlags; VAR count: DriverOpenCount; name: StringPtr; VAR device: RegEntryID; VAR driverLoadLocation: CFragSystem7Locator; VAR fragmentConnID: CFragConnectionID; VAR fragmentMain: DriverEntryPointPtr; VAR driverDesc: DriverDescription): OSErr; C;
  421. {$ELSEC}
  422. FUNCTION InstallDriverFromFragment(fragmentConnID: CFragConnectionID; VAR device: RegEntryRef; beginningUnit: UnitNumber; endingUnit: UnitNumber; VAR refNum: DriverRefNum): OSErr; C;
  423. FUNCTION InstallDriverFromFile(fragmentSpec: FSSpecPtr; VAR device: RegEntryRef; beginningUnit: UnitNumber; endingUnit: UnitNumber; VAR refNum: DriverRefNum): OSErr; C;
  424. FUNCTION InstallDriverFromMemory(memory: Ptr; length: LONGINT; fragName: Str63; VAR device: RegEntryRef; beginningUnit: UnitNumber; endingUnit: UnitNumber; VAR refNum: DriverRefNum): OSErr; C;
  425. FUNCTION InstallDriverFromDisk(theDriverName: Ptr; VAR theDevice: RegEntryRef; theBeginningUnit: UnitNumber; theEndingUnit: UnitNumber; VAR theRefNum: DriverRefNum): OSErr; C;
  426. FUNCTION FindDriversForDevice(VAR device: RegEntryRef; VAR fragmentSpec: FSSpec; VAR fileDriverDesc: DriverDescription; VAR memAddr: Ptr; VAR length: LONGINT; fragName: StringPtr; VAR memDriverDesc: DriverDescription): OSErr; C;
  427. FUNCTION FindDriverCandidates(VAR deviceID: RegEntryRef; VAR propBasedDriver: Ptr; VAR propBasedDriverSize: UInt32; deviceName: StringPtr; VAR propBasedDriverType: DriverType; VAR gotPropBasedDriver: BOOLEAN; fileBasedDrivers: FileBasedDriverRecordPtr; VAR nFileBasedDrivers: ItemCount): OSErr; C;
  428. FUNCTION ScanDriverCandidates(VAR deviceID: RegEntryRef; fileBasedDrivers: FileBasedDriverRecordPtr; nFileBasedDrivers: ItemCount; matchingDrivers: FileBasedDriverRecordPtr; VAR nMatchingDrivers: ItemCount): OSErr; C;
  429. FUNCTION GetDriverForDevice(VAR device: RegEntryRef; VAR fragmentConnID: CFragConnectionID; VAR fragmentMain: DriverEntryPointPtr; VAR driverDesc: DriverDescriptionPtr): OSErr; C;
  430. FUNCTION InstallDriverForDevice(VAR device: RegEntryRef; beginningUnit: UnitNumber; endingUnit: UnitNumber; VAR refNum: DriverRefNum): OSErr; C;
  431. {$ENDC}
  432. FUNCTION SetDriverClosureMemory(fragmentConnID: CFragConnectionID; holdDriverMemory: BOOLEAN): OSErr; C;
  433. FUNCTION ReplaceDriverWithFragment(theRefNum: DriverRefNum; fragmentConnID: CFragConnectionID): OSErr; C;
  434. FUNCTION OpenInstalledDriver(refNum: DriverRefNum; ioPermission: SInt8): OSErr; C;
  435. FUNCTION RenameDriver(refNum: DriverRefNum; newDriverName: StringPtr): OSErr; C;
  436. FUNCTION RemoveDriver(refNum: DriverRefNum; immediate: BOOLEAN): OSErr; C;
  437. FUNCTION LookupDrivers(beginningUnit: UnitNumber; endingUnit: UnitNumber; emptyUnits: BOOLEAN; VAR returnedRefNums: ItemCount; VAR refNums: DriverRefNum): OSErr; C;
  438. FUNCTION HighestUnitNumber: UnitNumber; C;
  439. FUNCTION DriverGestaltOn(refNum: DriverRefNum): OSErr; C;
  440. FUNCTION DriverGestaltOff(refNum: DriverRefNum): OSErr; C;
  441. FUNCTION DriverGestaltIsOn(flags: DriverFlags): BOOLEAN; C;
  442. {$ENDC}
  443. {$IFC NOT OLDROUTINELOCATIONS }
  444. {$IFC FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED }
  445. FUNCTION PBOpenSync(paramBlock: ParmBlkPtr): OSErr;
  446.     {$IFC NOT GENERATINGCFM}
  447.     INLINE $205F, $A000, $3E80;
  448.     {$ENDC}
  449. FUNCTION PBOpenAsync(paramBlock: ParmBlkPtr): OSErr;
  450.     {$IFC NOT GENERATINGCFM}
  451.     INLINE $205F, $A400, $3E80;
  452.     {$ENDC}
  453. FUNCTION PBOpenImmed(paramBlock: ParmBlkPtr): OSErr;
  454.     {$IFC NOT GENERATINGCFM}
  455.     INLINE $205F, $A200, $3E80;
  456.     {$ENDC}
  457. FUNCTION PBCloseSync(paramBlock: ParmBlkPtr): OSErr;
  458.     {$IFC NOT GENERATINGCFM}
  459.     INLINE $205F, $A001, $3E80;
  460.     {$ENDC}
  461. FUNCTION PBCloseAsync(paramBlock: ParmBlkPtr): OSErr;
  462.     {$IFC NOT GENERATINGCFM}
  463.     INLINE $205F, $A401, $3E80;
  464.     {$ENDC}
  465. FUNCTION PBCloseImmed(paramBlock: ParmBlkPtr): OSErr;
  466.     {$IFC NOT GENERATINGCFM}
  467.     INLINE $205F, $A201, $3E80;
  468.     {$ENDC}
  469. FUNCTION PBReadSync(paramBlock: ParmBlkPtr): OSErr;
  470.     {$IFC NOT GENERATINGCFM}
  471.     INLINE $205F, $A002, $3E80;
  472.     {$ENDC}
  473. FUNCTION PBReadAsync(paramBlock: ParmBlkPtr): OSErr;
  474.     {$IFC NOT GENERATINGCFM}
  475.     INLINE $205F, $A402, $3E80;
  476.     {$ENDC}
  477. FUNCTION PBReadImmed(paramBlock: ParmBlkPtr): OSErr;
  478.     {$IFC NOT GENERATINGCFM}
  479.     INLINE $205F, $A202, $3E80;
  480.     {$ENDC}
  481. FUNCTION PBWriteSync(paramBlock: ParmBlkPtr): OSErr;
  482.     {$IFC NOT GENERATINGCFM}
  483.     INLINE $205F, $A003, $3E80;
  484.     {$ENDC}
  485. FUNCTION PBWriteAsync(paramBlock: ParmBlkPtr): OSErr;
  486.     {$IFC NOT GENERATINGCFM}
  487.     INLINE $205F, $A403, $3E80;
  488.     {$ENDC}
  489. FUNCTION PBWriteImmed(paramBlock: ParmBlkPtr): OSErr;
  490.     {$IFC NOT GENERATINGCFM}
  491.     INLINE $205F, $A203, $3E80;
  492.     {$ENDC}
  493. PROCEDURE AddDrive(drvrRefNum: INTEGER; drvNum: INTEGER; qEl: DrvQElPtr);
  494. {$ENDC}
  495. FUNCTION GetDrvQHdr: QHdrPtr;
  496.     {$IFC NOT GENERATINGCFM}
  497.     INLINE $2EBC, $0000, $0308;
  498.     {$ENDC}
  499. {$ENDC}
  500. {  Control Panel Default Proc  }
  501. {$IFC FOR_SYSTEM7_ONLY }
  502.  
  503. TYPE
  504.     ControlPanelDefProcPtr = ProcPtr;  { FUNCTION ControlPanelDef(message: INTEGER; item: INTEGER; numItems: INTEGER; cPanelID: INTEGER; VAR theEvent: EventRecord; cdevValue: LONGINT; cpDialog: DialogPtr): LONGINT; }
  505.  
  506.     ControlPanelDefUPP = UniversalProcPtr;
  507.  
  508. CONST
  509.     uppControlPanelDefProcInfo = $000FEAB0;
  510.  
  511. FUNCTION NewControlPanelDefProc(userRoutine: ControlPanelDefProcPtr): ControlPanelDefUPP;
  512.     {$IFC NOT GENERATINGCFM }
  513.     INLINE $2E9F;
  514.     {$ENDC}
  515.  
  516. FUNCTION CallControlPanelDefProc(message: INTEGER; item: INTEGER; numItems: INTEGER; cPanelID: INTEGER; VAR theEvent: EventRecord; cdevValue: LONGINT; cpDialog: DialogPtr; userRoutine: ControlPanelDefUPP): LONGINT;
  517.     {$IFC NOT GENERATINGCFM}
  518.     INLINE $205F, $4E90;
  519.     {$ENDC}
  520. {$ENDC}
  521. FUNCTION GetDCtlEntry(refNum: INTEGER): DCtlHandle;
  522. {
  523.     SetChooserAlert used to simply set a bit in a low-mem global
  524.     to tell the Chooser not to display its warning message when
  525.     the printer is changed. However, under MultiFinder and System 7,
  526.     this low-mem is swapped out when a layer change occurs, and the
  527.     Chooser never sees the change. It is obsolete, and completely
  528.     unsupported on the PowerPC. 68K apps can still call it if they
  529.     wish.
  530.     
  531. }
  532. {$IFC OLDROUTINENAMES AND NOT GENERATINGCFM }
  533. FUNCTION SetChooserAlert(f: BOOLEAN): BOOLEAN;
  534. {$ENDC}
  535. FUNCTION DriverInstall(drvrPtr: DRVRHeaderPtr; refNum: INTEGER): OSErr;
  536.     {$IFC NOT GENERATINGCFM}
  537.     INLINE $301F, $205F, $A03D, $3E80;
  538.     {$ENDC}
  539. FUNCTION DriverInstallReserveMem(drvrPtr: DRVRHeaderPtr; refNum: INTEGER): OSErr;
  540.     {$IFC NOT GENERATINGCFM}
  541.     INLINE $301F, $205F, $A43D, $3E80;
  542.     {$ENDC}
  543. {
  544.   Note: DrvrInstall() is no longer supported, becuase it never really worked anyways.
  545.           There will soon be a DriverInstall() which does the right thing.
  546.  
  547.         DrvrRemove has been renamed to DriverRemove.  But, InterfaceLib for PowerPC
  548.         still exports DrvrRemove, so a macro is used to map the new name to old.
  549.  
  550. }
  551. FUNCTION DrvrRemove(refNum: INTEGER): OSErr;
  552.     {$IFC NOT GENERATINGCFM}
  553.     INLINE $301F, $A03E, $3E80;
  554.     {$ENDC}
  555. {$IFC GENERATING68K }
  556. FUNCTION DriverRemove(refNum: INTEGER): OSErr;
  557.     {$IFC NOT GENERATINGCFM}
  558.     INLINE $301F, $A03E, $3E80;
  559.     {$ENDC}
  560. {$ENDC}
  561. {
  562.     Shim mechnanism only exist in Copland world.  A Shim is a translation layer
  563.     and looks like a DRVR. 
  564. }
  565.  
  566. TYPE
  567.     ShimEntryPoint = ProcPtr;  { FUNCTION ShimEntryPoint(paramBlock: Ptr; refcon: Ptr): OSStatus; }
  568.  
  569. FUNCTION DriverInstallShim(drvrPtr: DRVRHeaderPtr; shim: ShimEntryPoint; refNum: INTEGER; refcon: UNIV Ptr): OSStatus;
  570. FUNCTION DriverRemoveShim(refNum: INTEGER): OSStatus;
  571. FUNCTION DriverReturnShimRefcon(refNum: INTEGER; VAR refcon: UNIV Ptr): OSStatus;
  572. {$IFC FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED }
  573. FUNCTION IOShimCommandIsComplete(thePB: ParmBlkPtr; result: OSErr): OSErr; C;
  574. {$ENDC}
  575. FUNCTION OpenDriver(name: Str255; VAR drvrRefNum: INTEGER): OSErr;
  576. FUNCTION CloseDriver(refNum: INTEGER): OSErr;
  577. FUNCTION Control(refNum: INTEGER; csCode: INTEGER; csParamPtr: UNIV Ptr): OSErr;
  578. FUNCTION Status(refNum: INTEGER; csCode: INTEGER; csParamPtr: UNIV Ptr): OSErr;
  579. FUNCTION KillIO(refNum: INTEGER): OSErr;
  580. {$IFC FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED }
  581. FUNCTION PBControlSync(paramBlock: ParmBlkPtr): OSErr;
  582.     {$IFC NOT GENERATINGCFM}
  583.     INLINE $205F, $A004, $3E80;
  584.     {$ENDC}
  585. FUNCTION PBControlAsync(paramBlock: ParmBlkPtr): OSErr;
  586.     {$IFC NOT GENERATINGCFM}
  587.     INLINE $205F, $A404, $3E80;
  588.     {$ENDC}
  589. FUNCTION PBControlImmed(paramBlock: ParmBlkPtr): OSErr;
  590.     {$IFC NOT GENERATINGCFM}
  591.     INLINE $205F, $A204, $3E80;
  592.     {$ENDC}
  593. FUNCTION PBStatusSync(paramBlock: ParmBlkPtr): OSErr;
  594.     {$IFC NOT GENERATINGCFM}
  595.     INLINE $205F, $A005, $3E80;
  596.     {$ENDC}
  597. FUNCTION PBStatusAsync(paramBlock: ParmBlkPtr): OSErr;
  598.     {$IFC NOT GENERATINGCFM}
  599.     INLINE $205F, $A405, $3E80;
  600.     {$ENDC}
  601. FUNCTION PBStatusImmed(paramBlock: ParmBlkPtr): OSErr;
  602.     {$IFC NOT GENERATINGCFM}
  603.     INLINE $205F, $A205, $3E80;
  604.     {$ENDC}
  605. FUNCTION PBKillIOSync(paramBlock: ParmBlkPtr): OSErr;
  606.     {$IFC NOT GENERATINGCFM}
  607.     INLINE $205F, $A006, $3E80;
  608.     {$ENDC}
  609. FUNCTION PBKillIOAsync(paramBlock: ParmBlkPtr): OSErr;
  610.     {$IFC NOT GENERATINGCFM}
  611.     INLINE $205F, $A406, $3E80;
  612.     {$ENDC}
  613. FUNCTION PBKillIOImmed(paramBlock: ParmBlkPtr): OSErr;
  614.     {$IFC NOT GENERATINGCFM}
  615.     INLINE $205F, $A206, $3E80;
  616.     {$ENDC}
  617. {$ENDC}
  618. FUNCTION OpenDeskAcc(deskAccName: Str255): INTEGER;
  619.     {$IFC NOT GENERATINGCFM}
  620.     INLINE $A9B6;
  621.     {$ENDC}
  622. PROCEDURE CloseDeskAcc(refNum: INTEGER);
  623.     {$IFC NOT GENERATINGCFM}
  624.     INLINE $A9B7;
  625.     {$ENDC}
  626. {$IFC OLDROUTINENAMES }
  627. {
  628.     The PBxxx() routines are obsolete.  
  629.     
  630.     Use the PBxxxSync(), PBxxxAsync(), or PBxxxImmed version instead.
  631. }
  632. {$IFC FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED }
  633. FUNCTION PBControl(paramBlock: ParmBlkPtr; async: BOOLEAN): OSErr;
  634. FUNCTION PBStatus(paramBlock: ParmBlkPtr; async: BOOLEAN): OSErr;
  635. FUNCTION PBKillIO(paramBlock: ParmBlkPtr; async: BOOLEAN): OSErr;
  636. {$IFC NOT OLDROUTINELOCATIONS }
  637. FUNCTION PBOpen(paramBlock: ParmBlkPtr; async: BOOLEAN): OSErr;
  638. FUNCTION PBClose(paramBlock: ParmBlkPtr; async: BOOLEAN): OSErr;
  639. FUNCTION PBRead(paramBlock: ParmBlkPtr; async: BOOLEAN): OSErr;
  640. FUNCTION PBWrite(paramBlock: ParmBlkPtr; async: BOOLEAN): OSErr;
  641. {$ENDC}
  642. {$ENDC}
  643. {$ENDC}
  644. {$IFC FOR_SYSTEM8_PREEMPTIVE }
  645. {
  646. //////////////////////////////////////////////////////////////////////////////
  647.  System 8 Ndrv requests entry point drivers
  648. }
  649. FUNCTION DoDeviceManagerIO(commandID: IOCommandID; contents: IOCommandContents; code: IOCommandCode; kind: IOCommandKind; VAR someTypeofNotification: KernelNotification): OSStatus; C;
  650.  
  651. TYPE
  652.     DeviceManagerIOIteratorDataPtr = ^DeviceManagerIOIteratorData;
  653.     DeviceManagerIOIteratorData = RECORD
  654.         ioCI:                    IOCommonInfo;
  655.         pluginNumber:            INTEGER;
  656.         refNum:                    INTEGER;
  657.         desc:                    DriverDescription;
  658.     END;
  659.  
  660. FUNCTION DeviceManagerGetDeviceData(requestItemCount: ItemCount; VAR totalItemCount: ItemCount; VAR dataArray: DeviceManagerIOIteratorDataPtr): OSStatus; C;
  661. {$ENDC}
  662. {$ALIGN RESET}
  663. {$POP}
  664.  
  665. {$SETC UsingIncludes := DevicesIncludes}
  666.  
  667. {$ENDC} {__DEVICES__}
  668.  
  669. {$IFC NOT UsingIncludes}
  670.  END.
  671. {$ENDC}
  672.